package com.aplink.generic.util.objectrule;

import com.aplink.generic.pojo.GenericObject;

public class TargetRule {
    private ActionBaseRule actionBaseRule;
    private String targetActivity;

    public TargetRule() {
        this.targetActivity = "";
        this.actionBaseRule = null;
    }

    public TargetRule( String _targetActivity, ActionBaseRule _actionBaseRule ) {

        this.targetActivity = _targetActivity;
        this.actionBaseRule = _actionBaseRule;
    }

    public ActionBaseRule getActionBaseRule() {
        return this.actionBaseRule;
    }

    public String getTargetActivity() {
        return this.targetActivity;
    }

    public boolean isSatisfiedCondition( GenericObject genericObject ) {
        boolean isSatisfied = false;
        if ( genericObject != null ) {
            isSatisfied = this.actionBaseRule
                    .isSatisfiedActionRule( genericObject );
        }
        return isSatisfied;
    }

    public void setActionBaseRule( ActionBaseRule actionBaseRule ) {
        this.actionBaseRule = actionBaseRule;
    }

    public void setTargetActivity( String targetActivity ) {
        this.targetActivity = targetActivity;
    }

}
